package com.hmall.user.inner;

import com.hmall.user.service.IUserService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户内部接口")
@RestController
@RequestMapping("/inner/users")
@RequiredArgsConstructor
@Slf4j
public class UserControllerInner {

    private final IUserService userService;

    @PutMapping("/money/deduct")
    public void deductMoney(@RequestParam Long userId,@RequestParam("pw") String pw, @RequestParam("amount") Integer amount) {
        userService.deductMoney(userId,pw, amount);
    }
}
